import $http from '@/assets/js/http'
//查询学院列表
export function getSchoolList(name, index, size) {
    return $http.get('manage/college/category/list', {
        params: { name: name, pageIndex: index, pageSize: size }
    });
}
//删除学院
export function postDeleteSchool(delId) {
    return $http.post('manage/college/category/delete', {
        id: delId
    });
}
//新增学院
export function postAddSchool(param) {
    return $http.post('manage/college/category/add', {
        name: param.name,
        logo: param.logo
    });
}
//查询学院
export function postSelectSchool(id) {
    return $http.get('manage/college/category/detail', {
        params: { id: id }
    });
}
//编辑学院
export function postEditSchool(param) {
    return $http.post('manage/college/category/edit', {
        id: param.id,
        name: param.name,
        logo: param.logo
    });
}

//资讯列表
export function getSchoolNewsList(param) {
    return $http.get('manage/college/info/list', {
        params: {
            title: param.title,
            categoryName: param.categoryName,
            beginDate: param.beginDate,
            endDate: param.endDate,
            pageIndex: param.pageIndex,
            pageSize: param.pageSize
        }
    });
}
//删除资讯
export function postDeleteSchoolNews(delId) {
    return $http.post('manage/college/info/delete', {
        id: delId
    });
}
//查询资讯
export function getSchoolNewsDetail(id) {
    return $http.get('manage/college/info/detail', {
        params: {
            id: id
        }
    });
}
//发布资讯
export function postDeleteSchoolNewsAdd(param) {
    return $http.post('manage/college/info/add', {
        title: param.title,
        content: param.content,
        headImg: param.headImg,
        categoryId: param.categoryId,
        readNum: param.readNum,
        authorize: param.authorize,
        keywords: param.keywords
    });
}




//查询媒体列表
export function getMediaList(name,type, index, size) {
    return $http.get('/manage/media/category/list', {
        params: { name: name, type:type,pageIndex: index, pageSize: size }
    });
}

//删除媒体
export function postDeleteMedia(delId) {
    return $http.post('manage/media/category/delete', {
        id: delId
    });
}

//新增媒体
export function postAddMedia(param) {
    return $http.post('manage/media/category/add', {
        type: param.type,
        name: param.name,
        logo: param.logo
    });
}

//编辑媒体
export function postEditMedia(param) {
    return $http.post('manage/media/category/edit', {
        id: param.id,
        type: param.type,
        name: param.name,
        logo: param.logo
    });
}

//查询媒体
export function postQueryMedia(id) {
    return $http.get('manage/media/category/detail', {
        params: { id: id }
    });
}


//查询媒体资讯列表
export function getMediaNewsList(params) {
    return $http.get('/manage/media/info/list', {
        params: { 
        	type:params.type, 
        	title:params.title,
        	categoryId:params.categoryId,
        	categoryName:params.categoryName,
        	beginDate:params.beginDate,
        	endDate:params.endDate,
        	pageIndex: params.pageIndex,
        	pageSize: params.pageSize 
        }
    });
}

//删除媒体资讯
export function postDeleteMediaNews(delId) {
    return $http.post('manage/media/info/delete', {
        id: delId
    });
}

//新增媒体资讯
export function postAddMediaNews(param) {
    return $http.post('manage/media/info/add', {
        lType:param.lType,
        type:param.type,
        title:param.title,
        content:param.content,
        headImg:param.headImg,
        categoryId:param.categoryId,
        authorize:param.authorize,
        keywords:param.keywords
    });
}

//编辑媒体资讯
export function postEditMediaNews(param) {
    return $http.post('manage/media/info/edit', {
        id:param.id,
        lType:param.lType,
        type:param.type,
        categoryId:param.categoryId,
        title:param.title,
        headImg:param.headImg,
        content:param.content,
        authorize:param.authorize,
        keywords:param.keywords,
    });
}

//查询媒体资讯
export function postQueryMediaNews(id) {
    return $http.get('/manage/media/info/detail', {
        params: { id: id }
    });
}


//查询协会列表
export function getAssociationList(name, index, size) {
    return $http.get('/manage/society/category/list', {
        params: { categoryName: name, pageIndex: index, pageSize: size }
    });
}

//删除协会
export function postDeleteAssociation(delId) {
    return $http.post('manage/society/category/delete', {
        id: delId
    });
}

//新增协会
export function postAddAssociation(param) {
    return $http.post('manage/society/category/add', {
        categoryName: param.name,
        logo: param.logo
    });
}

//编辑协会
export function postEditAssociation(param) {
    return $http.post('manage/society/category/update', {
        id: param.id,
        categoryName: param.name,
        logo: param.logo
    });
}



//编辑资讯
export function postSchoolNewsEdit(param) {
    return $http.post('/manage/college/info/edit', {
        id: param.id,
        title: param.title,
        content: param.content,
        headImg: param.headImg,
        categoryId: param.categoryId,
        readNum: param.readNum,
        authorize: param.authorize,
        keywords: param.keywords
    });
}

//查询协会资讯列表
export function getAssociationNews(param){
	return $http.get('/manage/society/info/list',{
		params:{
			title:param.title,
			societyName:param.categoryName,//协会名称
			pageIndex:param.pageIndex,
			pageSize:param.pageSize
		}
	})
}

//删除协会资讯
export function postDeleteAssociationNews(delId) {
    return $http.post('/manage/society/info/delete', {
        id: delId
    });
}


//新增协会资讯
export function postAddAssociationNews(param) {
    return $http.post('/manage/society/info/publish', {
        title:param.title,
        content:param.content,
        headImg:param.headImg,
        categoryId:param.categoryId,
        authorize:param.authorize,
        keywords:param.keywords,
    });
}

//编辑协会资讯
export function postEditAssociationNews(param) {
    return $http.post('/manage/society/info/update', {
    	id:param.id,
        title:param.title,
        content:param.content,
        headImg:param.headImg,
        categoryId:param.categoryId,
        authorize:param.authorize,
        keywords:param.keywords,
    });
}

//查询协会资讯详情
export function postQueryAssociationNews(id) {
    return $http.post('/manage/society/info/detail', {
        id:id
    });
}


/*展会----START*/
//展会列表
export function exbList(param){
	return $http.get('/manage/exhibition/list',{
		params:{
			title:param.title,
			type:param.type,
			pageIndex:param.pageIndex,
			pageSize:param.pageSize
		}
	})
}

//展会详情
export function exbQuery(id){
	return $http.get('/manage/exhibition/getDetail',{
		params:{
			id:id
		}
	})
}

//发布展会
export function exbAdd(param){
	return $http.post('/manage/exhibition/add',{
		type:param.type,
		headImg:param.headImg,
		title:param.title,
		content:param.content,
		authorize:param.authorize,
		source:param.source,
		keywords:param.keywords,
		timeSlot:param.timeSlot,
	})
}

//编辑展会
export function exbEdit(param){
	return $http.post('/manage/exhibition/update',{
		id:param.id,
		type:param.type,
		headImg:param.headImg,
		title:param.title,
		content:param.content,
		authorize:param.authorize,
		source:param.source,
		keywords:param.keywords,
		timeSlot:param.timeSlot,
	})
}
//删除展会
export function exbDelete(id){
	return $http.post('/manage/exhibition/delete',{
		id:id,
	})
}

/*展会----END*/
